#依赖镜像名称和ID
FROM python:3.9-alpine
# 修改镜像源为阿里云
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 发装中文字体
RUN apk update && apk add font-noto-cjk mariadb-connector-c-dev build-base musl-dev linux-headers
#指定镜像创建者信息
MAINTAINER yzk
#切换工作目录
RUN mkdir /soft
WORKDIR /soft

# 复制项目文件到工作目录
COPY . /soft

#COPY ./requirements.txt /soft/requirements.txt
RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
# 在收集静态文件之前创建静态文件目录（可以省略这一步）
# RUN mkdir -p /home/project/Mao_Shi_Jie/mao_shi_jie/static
RUN python manage.py collectstatic --noinput
#CMD ["uwsgi", "-x", "./luffy.xml"]
CMD ["uwsgi", "./mao_shi_jie.ini"]
#CMD ["python", "manage_pro.py", "runserver"]